<template>
	<view>
		<view class="title">{{title}}</view>
		<text class="time">{{time}}</text>
		<view class="con">
			<text>
					{{content}}
			</text>
		
		</view>
	</view>
</template>

<script>
	import http from '@/shopro/request/index'
	export default {
		data() {
			return {
				content:'',
				time:'',
				title:''
			}
		},
		methods: {
			
		},
		onLoad(options) {
			if(options.type=='news'){
				http('user.userNewsDetail',{id:~~options.id}).then(res=>{
					console.log(res);
					this.time = res.data.createtime
					this.content = res.data.content
					this.title = res.data.title
				})
			} else {
				http('user.userArticleDetail',{id:~~options.id}).then(res=>{
					console.log(res);
					this.time = res.data.createtime
					this.content = res.data.content
					this.title = res.data.title
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding: 5px 8px;
		box-sizing: border-box;
	}
.title{
	text-align: center;
	font-size: 18px;
	color: #000;
	font-weight: bold;
}
.time {
	display: block;
	text-align: center;
}
.con {
	text {
		font-size: 16px;
	}
	width: 90%;
	margin:0 auto;
	// padding-right: 15px;
}
</style>
